#ifndef AUDIOFRAME_H
#define AUDIOFRAME_H

#include <QtGlobal>  // 使用Qt的全局类型定义

struct AVFrame;


class AudioFrame
{
public:
    explicit AudioFrame(AVFrame* frame=nullptr,int64_t ptsMs=0);

    ~AudioFrame();


    //禁止拷贝
    AudioFrame(const AudioFrame&) = delete;
    AudioFrame& operator=(const AudioFrame&) = delete;


    //启动移动语句

    AudioFrame(AudioFrame&&) noexcept;
    AudioFrame& operator=(AudioFrame&&) noexcept;


    //查询函数
    bool isValid() const;
    AVFrame* getRawFrame() const;           // 改名：getFrame → getRawFrame
    int getSampleRate() const;
    int getChannels() const;
    int getNbSamples() const;
    int getFormat() const;

    int64_t getPtsMs() const;
    void setPtsMs(int64_t ptsMs);

    uint8_t** getData() const;
    int* getLinesize() const;               // 改名：getLineSize → getLinesize

    void release();
private:
    AVFrame* m_frame;
    int64_t m_ptsMs;

};  // 添加分号

#endif
